<%@page import="domain.Project"%>
<%@page import="domain.Criteria"%>
<%@page import="java.util.*"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<%
	Project project = (Project) request.getAttribute("project");
	List<Criteria> criterias = project.getCriterias();
%>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title><%=project.getName() %>'s Preference'</title>
<link href="./resources/style/mainStyle.css" rel="stylesheet" type="text/css" />
</head>
<body>
<br/>
	<div align="center">
		<div class='box' style="width: 60%" align="center">
			<div class='boxtop'><div></div></div>
		  		<div class='boxcontent'>
		  			<u><%= project.getGoal()%></u>
		  			<div align="left">
			  			<form action="./preferenceGoal" method="post">
						<input type="hidden" name="projectId" value="<%=project.getId() %>"/>
						<input type="hidden" name="type" value="project"/>
			  					<%
				  					for(int i=0; criterias!=null && i<criterias.size(); i++){
				  						Criteria criteria = criterias.get(i);
				  						if(criteria.getSubOf()==null){
			  							
				  						for(int k=i+1; k<criterias.size(); k++){
				  							Criteria tempCriteria = criterias.get(k);
				  							if(tempCriteria.getSubOf()==null){
				  				%>
										<i><%= criteria.getName()%></i> Compare To <i><%= tempCriteria.getName()%></i>
										<input type="hidden" name="subject" value="<%= criteria.getId()%>"/>
										<input type="hidden" name="object" value="<%= tempCriteria.getId()%>"/>
										<ul>
											<li>
												<select name="preference" id="preference<%= criteria.getName()%><%= tempCriteria.getName()%>">
													<option value="<%=criteria.getId() %>"><%=criteria.getName() %></option>
													<option value="<%=tempCriteria.getId() %>"><%=tempCriteria.getName() %></option>
												</select>
												is more important with 
												<select name="score" id="score<%= criteria.getName()%><%= tempCriteria.getName()%>">
													<option value="1">Equally preferred</option>
													<option value="2">Equally to moderately</option>
													<option value="3">Moderately preferred</option>
													<option value="4">Moderately to strongly</option>
													<option value="5">Strongly preferred</option>
													<option value="6">Strongly to very strongly</option>
													<option value="7">Very strongly preferred</option>
													<option value="8">Very strongly to extremely</option>
													<option value="9">Extremely preferred</option>
												</select>
												level
											</li>
										</ul>
				  					<%}}} %>
				  				<%} %>
							<input class="button black" type="submit" value="Save" />
			   			</form>
		  			</div>
		  		</div>
		 	<div class='boxbottom'><div></div></div>
		</div>
	</div>
</body>
</html>